package com.ykdl.member.kid.prefs;

import android.R.integer;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
/**
 * 存放我的圈子信息，是否加入了某个圈子
 * 
 * @param result
 */
public class CircleStatePrefs {
	private static SharedPreferences settings;
	private static SharedPreferences.Editor editor;
	//private static final String CIRCLESTATE = "state";
	private static final String CIRCLESTATENAME = "circlestate";

	public CircleStatePrefs(Context context) {
		if (settings == null) {
			settings = context.getSharedPreferences(CIRCLESTATENAME,
					Activity.MODE_PRIVATE);
			if (editor == null) {
				editor = settings.edit();
			}
		} else {
			if (editor == null) {
				editor = settings.edit();
			}
		}
	}

	public void setCircleState(String id, String state) {
		editor.putString(id, state);
		editor.commit();
	}

	public String getCircleState(String id) {
		return settings.getString(id, "false");
	}
	
	public void setCirclePoint(String key){
		editor.putString(key, key);
		editor.commit();
	}
	
	public String  getCirclePoint(String key){
		return settings.getString(key, null);
	}
	
	public void  clearData( ){
		editor.clear();
		editor.commit();
	}
}
